//
//  ZCNetworkManager.m
//  zctx
//
//  Created by ZhengDarren on 15/9/28.
//  Copyright © 2015年 sanliang. All rights reserved.
//

#import "ZCNetworkManager.h"

@implementation ZCNetworkManager

+ (ZCNetworkManager *)sharedInstance
{
    static ZCNetworkManager *sharedInstance = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        sharedInstance = [[self alloc] init];
    });
    return sharedInstance;
}

// 请求头
-(NSString *)strURLBasic{
    
//    return @"http://test.1mdj.com";
    
//    return @"http://test.zhongcetianxia.com";  //测试
    
    return @"http://www.zhongcetianxia.com";  //正式
}


- (NSString *)strURLHeader
{
    NSString *urlStr = [NSString  stringWithFormat:@"%@%@",[self strURLBasic],@"/index.php/Api/V3"];
    return urlStr;
}

//-----------------------------以下为业务代码-------------------------------------

//1.1 请求头

- (void)requestUrlRequestHeaderssuccess:(void (^)(NSString *urlStr))blockSuccess failure:(void (^)(NSError *error))blockFailure{
    
    [super getWithURLString:URL_REQUEST_HEADER
                     params:nil
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         
         
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

    
}

// 2.1 验证码下发接口

- (void)requestGetVerifyCodeWithAction:(NSString *)strAction
                                mobile:(NSString *)strMobile
                               success:(void (^)(NSDictionary *dictResponse))blockSuccess
                               failure:(void (^)(NSError *error))blockFailure
{
    if (!(strAction && strMobile))
    {
        return;
    }
    
    [super getWithURLString:URL_GET_VERIFY_CODE
                     params:@{@"action":strAction,
                              @"mobile":strMobile}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//2.1.6 获取用户红包
- (void)requestGetMyRedpackWithmid:(NSString *)strmid
                          password:(NSString *)strpassword
                              type:(NSString *)strtype
                         pagecount:(NSString *)strpagecount
                             rp_id:(NSString *)strrp_id
                           success:(void (^)(NSDictionary *dictResponse))blockSuccess
                           failure:(void (^)(NSError *error))blockFailure{
    
    [super getWithURLString:URL_GET_MY_REDPACK
                     params:@{@"mid":strmid,
                              @"password":strpassword,
                              @"type":strtype,
                              @"pagecount":strpagecount,
                              @"rp_id":strrp_id}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
         failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

}

// 2.2验证码验证接口
- (void)requestVerifyCodeWithCode:(NSString *)strCode
                           mobile:(NSString *)strMobile
                     device_token:(NSString *)strdevice_token
                          success:(void (^)(NSDictionary *dictResponse))blockSuccess
                          failure:(void (^)(NSError *error))blockFailure{
    
    if (!(strCode && strMobile && strdevice_token))
    {
        return;
    }
    
    [super getWithURLString:URL_VERIFY_CODE
                     params:@{@"code":strCode,
                              @"mobile":strMobile,
                              @"device_token":strdevice_token,
                              @"from_type":@"2"}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {         
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *) responseObject;
             blockSuccess(dict);
         }
    }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

    
}

//2.3 用户刷新个人资料接口

- (void)requestGetMemberInfoWithMid:(NSString *)strMid
                           password:(NSString *)strPassword
                       device_token:(NSString *)strdevice_token
                            success:(void (^)(NSDictionary *dictResponse))blockSuccess
                            failure:(void (^)(NSError *error))blockFailure{
    if (!(strMid && strPassword && strdevice_token))
    {
        return;
    }
    
    [super getWithURLString:URL_GET_MEMBER_INFO
                     params:@{@"mid":strMid,
                              @"password":strPassword,
                              @"device_token":strdevice_token,
                              @"from_type":@"2"}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict = (NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

}


//2.3.1 微信登陆接口
- (void)requestGetMemberInfobyunionidWithUnionid:(NSString *)strUnionid
                                          openid:(NSString *)strOpenid
                                       from_type:(NSString *)strfromType
                                    device_token:(NSString *)strdevice_token
                                         success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                         failure:(void (^)(NSError *error))blockFailure{
    if (!(strUnionid && strOpenid && strfromType && strdevice_token))
    {
        return;
    }
    
    NSMutableDictionary *mDictParams = [NSMutableDictionary new];
    [mDictParams setObject:strUnionid forKey:@"unionid"];
    [mDictParams setObject:strOpenid forKey:@"openid"];
    [mDictParams setObject:@"2" forKey:@"from_type"];
    [mDictParams setObject:strdevice_token forKey:@"device_token"];
    
    [super getWithURLString:URL_GET_MEMBER_INFO_BY_UNIONID
                     params:mDictParams
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject[@"content"] isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *) responseObject[@"content"];
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//2.3.2 新微信登陆接口
- (void)requestGetMemberInfobyunionidWithUnionidNewid:(NSString *)strUnionid
                                               openid:(NSString *)strOpenid
                                            from_type:(NSString *)strfromType
                                         device_token:(NSString *)strdevice_token
                                             nickname:(NSString *)strnickname
                                                  sex:(NSString *)strsex
                                             province:(NSString *)strprovince
                                                 city:(NSString *)strcity
                                              country:(NSString *)strcountry
                                           headimgurl:(NSString *)strheadimgurl
                                            privilege:(NSString *)strprivilege
                                              success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                              failure:(void (^)(NSError *error))blockFailure{
    if (!(strUnionid && strOpenid && strfromType && strdevice_token))
    {
        return;
    }
    
    NSMutableDictionary *mDictParams = [NSMutableDictionary new];
    [mDictParams setObject:strUnionid forKey:@"unionid"];
    [mDictParams setObject:strOpenid forKey:@"openid"];
    [mDictParams setObject:@"2" forKey:@"from_type"];
    [mDictParams setObject:strdevice_token forKey:@"device_token"];
    [mDictParams setObject:strnickname forKey:@"nickname"];
    [mDictParams setObject:strsex forKey:@"sex"];
    [mDictParams setObject:strprovince forKey:@"province"];
    [mDictParams setObject:strcity forKey:@"city"];
    [mDictParams setObject:strcountry forKey:@"country"];
    [mDictParams setObject:strheadimgurl forKey:@"headimgurl"];
    [mDictParams setObject:strprivilege forKey:@"privilege"];

    
    [super postWithURLString:URL_GET_MEMBER_INFO_BY_UNIONID_NEW
                     params:mDictParams
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject[@"content"] isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *) responseObject[@"content"];
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

}



//2.4 获取分享到微信朋友圈的信息

- (void)requestGetMyshareWithMid:(NSString *)strmid
                        password:(NSString *)strpassword
                         success:(void (^)(NSDictionary *dictResponse))blockSuccess
                         failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strpassword))
    {
        return;
    }
    
    [super getWithURLString:URL_GET_MY_SHARE
                     params:@{@"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         
         if ([[responseObject objectForKey:@"content"]isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)[responseObject objectForKey:@"content"];
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
    
}
// 2.5获取我的通知
- (void)requestGetMyNoticeWithMid:(NSString *)strmid password:(NSString *)strpassword success:(void (^)(NSArray *))blockSuccess failure:(void (^)(NSError *))blockFailure{
    
    if (!(strmid && strpassword))
    {
        return;
    }
    [super getWithURLString:URL_GET_MY_NOTICE
                     params:@{@"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([[responseObject objectForKey:@"content"] isKindOfClass:[NSArray class]]) {
             NSArray *dict = (NSArray *)[responseObject objectForKey:@"content"];
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//2.6 获取我的项目

- (void)requestGetMyOrdersWithMid:(NSString *)strmid
                         password:(NSString *)strpassword
                          success:(void (^)(NSDictionary *ArrayResponse))blockSuccess
                          failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strpassword))
    {
        return;
    }
    [super getWithURLString:URL_GET_MY_ORDERS
                     params:@{@"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict = (NSDictionary *)responseObject;
             blockSuccess(dict);
         }
    }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}


//2.7 修改用户名

- (void)requestModifyusernameWithMid:(NSString *)strmid
                            username:(NSString *)strusername
                             success:(void (^)(NSDictionary *ArrayResponse))blockSuccess
                             failure:(void (^)(NSError *error))blockFailure{
    
    if (!(strmid && strusername))
    {
        return;
    }
    [super getWithURLString:URL_MODIFY_USERNAME
                     params:@{@"mid":strmid,
                              @"username":strusername}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         NSDictionary *dict = (NSDictionary *)responseObject;
         blockSuccess(dict);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//2.8 修改手机号
- (void)requestModifymobileWithMid:(NSString *)strmid
                            mobile:(NSString *)strmobile
                           success:(void (^)(NSDictionary *ArrayResponse))blockSuccess
                           failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strmobile))
    {
        return;
    }
    [super getWithURLString:URL_MODIFY_MOBILE
                     params:@{@"mid":strmid,
                              @"mobile":strmobile}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         NSDictionary *dict = (NSDictionary *)responseObject;
         blockSuccess(dict);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//2.9 修改性别
- (void)requestModifygenderWithMid:(NSString *)strmid
                            gender:(NSString *)strgender
                           success:(void (^)(NSDictionary *ArrayResponse))blockSuccess
                           failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strgender))
    {
        return;
    }
    [super getWithURLString:URL_MODIFY_GENDER
                     params:@{@"mid":strmid,
                              @"gender":strgender}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         NSDictionary *dict = (NSDictionary *)responseObject;
         blockSuccess(dict);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//2.10 修改地址
- (void)requestModifyaddressWithMid:(NSString *)strmid
                              code:(NSString *)strcode
                           address:(NSString *)straddress
                           success:(void (^)(NSDictionary *ArrayResponse))blockSuccess
                           failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strcode &&straddress))
    {
        return;
    }
    [super getWithURLString:URL_MODIFY_ADRESS
                     params:@{@"mid":strmid,
                              @"code":strcode,
                              @"address":straddress}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         NSDictionary *dict = (NSDictionary *)responseObject;
         blockSuccess(dict);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//2.11 修改生日
- (void)requestModifybirthdayWithMid:(NSString *)strmid
                            birthday:(NSString *)strbirthday
                             success:(void (^)(NSDictionary *ArrayResponse))blockSuccess
                             failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strbirthday))
    {
        return;
    }
    [super getWithURLString:URL_MODIFY_BIRTHDAY
                     params:@{@"mid":strmid,
                              @"birthday":strbirthday}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         NSDictionary *dict = (NSDictionary *)responseObject;
         blockSuccess(dict);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//2.12 修改用户头像
- (void)requestModifyavatarWithMid:(NSString *)strmid
                          password:(NSString *)strpassword
                            avatar:(NSArray *)stravatar
                           success:(void (^)(NSData *data))blockSuccess
                           failure:(void (^)(NSError *error))blockFailure{
    
    if (!(strmid && strpassword && stravatar))
    {
        return;
    }

    NSMutableDictionary *mDictParams = [NSMutableDictionary new];
    [mDictParams setObject:strmid forKey:@"mid"];
    [mDictParams setObject:strpassword forKey:@"password"];
    
    [super uploadWithURLString:URL_MODIFY_AVATAR params:mDictParams images:stravatar filename:@"avatar" success:^(AFHTTPRequestOperation *operation, id responseObject) {
        NSLog(@"图片1123");
        blockSuccess(responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
    }];
}

//2.13 用户反馈
- (void)requestMembersubfeedbackWithMid:(NSString *)strmid
                                contact:(NSString *)strcontact                            content:(NSString *)strcontent
                                success:(void (^)(NSDictionary *data))blockSuccess
                                failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strcontact && strcontent)) {
        return;
    }
    [super getWithURLString:URL_MEMBER_SUB_FEEDBACK
                     params:@{@"mid":strmid,
                              @"contact":strcontact,
                              @"content":strcontent}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         NSDictionary *dict = (NSDictionary *)responseObject;
         blockSuccess(dict);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//2.14 我的消息
- (void)requestMemberMessageWithMid:(NSString *)strmid
                           password:(NSString *)strpassword
                            success:(void (^)(NSDictionary *data))blockSuccess
                            failure:(void (^)(NSError *error))blockFailure{
    
    if (!(strmid && strpassword))
    {
        return;
    }
    [super getWithURLString:URL_MEMBER_MESSAGE
                     params:@{@"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         NSDictionary *dict = (NSDictionary *)responseObject;
         blockSuccess(dict);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//2.15 健康豆明细
- (void)requestMemberGetbeansdetailWithMid:(NSString *)strmid
                                  password:(NSString *)strpassword
                                   success:(void (^)(NSDictionary*data))blockSuccess
                                   failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strpassword))
    {
        return;
    }
    [super getWithURLString:URL_MEMBER_GET_BEANS_DETAIL
                     params:@{@"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         NSDictionary *dict = (NSDictionary *)responseObject;
         blockSuccess(dict);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//2.16 "我的"推荐给盆友 分享
- (void)requestMemberShareFromAppWithsuccess:(void (^)(NSDictionary *dictResponse))blockSuccess failure:(void (^)(NSError *error))blockFailure{
    
    
    [super getWithURLString:URL_MEMBER_SHARE_FROM_APP
                     params:nil
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([[responseObject objectForKey:@"content"]isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)[responseObject objectForKey:@"content"];
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//3.0 获取产品分类
- (void)requestFoundinggetsortsWithsuccess:(void (^)(NSArray *dict))blockSuccess failure:(void (^)(NSError *error))blockFailure{
    
    [super getWithURLString:URL_UOUNDING_GET_SORTS
                     params:nil
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([[responseObject objectForKey:@"content"]isKindOfClass:[NSArray class]]) {
             NSArray *dict = (NSArray *)[responseObject objectForKey:@"content"];
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

}


//3.1 获取套餐列表
- (void)requestFoundingGetPackagesWithSortid:(NSString *)strSortid success:(void (^)(NSMutableArray *array))blockSuccess failure:(void (^)(NSError *error))blockFailure{
    
    NSMutableDictionary *mDictParams = [NSMutableDictionary new];
    [mDictParams setObject:strSortid forKey:@"sortid"];
    [super getWithURLString:URL_FOUNDING_GET_PACKAGES
                     params:mDictParams
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([[responseObject objectForKey:@"content"]isKindOfClass:[NSArray class]]) {
             NSArray *dict = (NSArray *)[responseObject objectForKey:@"content"];
             NSMutableArray *array  =[NSMutableArray arrayWithCapacity:0];
             for (NSDictionary *dic in dict) {
                 ZCItemModelContent *model = [ZCItemModelContent modelObjectWithDictionary:dic];
                 [array addObject:model];
             }
             blockSuccess(array);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
    
}

// 3.1.1 获取检测套餐详情
- (void)requestFoundingGetPackageWithId:(NSString *)strId
                                success:(void (^)(ZCItemModelContent *model))blockSuccess
                                failure:(void (^)(NSError *error))blockFailure {
    if (!strId) {
        return;
    }
    [super getWithURLString:URL_FOUNDING_GET_PACKAGES_INFORMATION
                     params:@{@"id":strId}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         NSDictionary *dict =(NSDictionary *) responseObject;
         ZCItemModelContent *model = [ZCItemModelContent modelObjectWithDictionary:dict];
         blockSuccess(model);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}


//3.2 获取第三方检测机构列表
- (void)requestFoundingGetLabssuccess:(void (^)(NSArray *array))blockSuccess
                              failure:(void (^)(NSError *error))blockFailure{
    
    
    [super getWithURLString:URL_FOUNDING_GET_LABS
                     params:nil
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         NSArray *array = [responseObject dz_modelsForArrayKey:@"content"
                                                modelClassName:@"ZCMechanismModel" except:nil block:nil];
         blockSuccess(array);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
    
}

//3.3 发布众筹提交后台审核
- (void)requestFoundingPublishWithMid:(NSString *)strmid
                             password:(NSString *)strpassword
                               pjname:(NSString *)strpjname
                               pdname:(NSString *)strpdname
                             citycode:(NSString *)strcitycode
                                brand:(NSString *)strbrand
                            packageid:(NSString *)strpackageid
                        institutionid:(NSString *)instiutionid
                               emoney:(NSString *)stremoney
                             fromtype:(NSString *)strfromtype
                              content:(NSString *)strcontent
                           categoryid:(NSString *)strcategoryid
                             sampleid:(NSString *)strsampleid
                              success:(void (^)(NSDictionary *dictResponse))blockSuccess
                              failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strpassword && strpjname && strpdname && strcitycode && strbrand && strpackageid && instiutionid && stremoney && strfromtype))
    {
        return;
    }
    NSMutableDictionary *mDictParams = [NSMutableDictionary new];
    [mDictParams setObject:strmid forKey:@"mid"];
    [mDictParams setObject:strpassword forKey:@"password"];
    [mDictParams setObject:strpjname forKey:@"pjname"];
    [mDictParams setObject:strpdname forKey:@"pdname"];
    [mDictParams setObject:strcitycode forKey:@"citycode"];
    [mDictParams setObject:strbrand forKey:@"brand"];
    [mDictParams setObject:strpackageid forKey:@"packageid"];
    [mDictParams setObject:instiutionid forKey:@"institutionid"];
    [mDictParams setObject:stremoney forKey:@"emoney"];
    [mDictParams setObject:strfromtype forKey:@"fromtype"];
    [mDictParams setObject:strcontent forKey:@"content"];
    [mDictParams setObject:strcategoryid forKey:@"categoryid"];
    [mDictParams setObject:strsampleid forKey:@"sampleid"];
    
    [super postWithURLString:URL_FOUNDING_PUBLISH
                       params:mDictParams
                      success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         blockSuccess(responseObject);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}
//3.3.1 提交众筹项目的图片上传
- (void)requestFoundingPublishimageuploadMid:(NSString *)strmid
                            password:(NSString *)strpassword
                               image:(NSArray *)strimage
                             success:(void (^)(NSData *data))blockSuccess
                             failure:(void (^)(NSError *error))blockFailure{
    
    if (!(strmid && strpassword && strimage))
    {
        return;
    }
    NSMutableDictionary *mDictParams = [NSMutableDictionary new];
    [mDictParams setObject:strmid forKey:@"mid"];
    [mDictParams setObject:strpassword forKey:@"password"];
    
    [super uploadWithURLString:URL_FOUNDING_PUBLISH_IMAGE_UPLOAD params:mDictParams images:strimage filename:@"image" success:^(AFHTTPRequestOperation *operation, id responseObject) {
        NSLog(@"图片1123");
         blockSuccess(responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
    }];
}

//3.4 获取众筹列表(包括搜索功能)

- (void)requestFoundingGetAllWithType:(NSString *)strtype
                                  mid:(NSString *)strmid
                             password:(NSString *)strpassword
                                mtype:(NSString *)strmtype
                            pagecount:(NSString *)strpagecount
                             keywords:(NSString *)strkeywords
                              success:(void (^)(NSDictionary *array))blockSuccess
                              failure:(void (^)(NSError *error))blockFailure{
    if (!(strtype && strmid && strpassword && strmtype && strpagecount && strkeywords))
    {
        return;
    }
    
    NSMutableDictionary *mDictParams = [NSMutableDictionary new];
    [mDictParams setObject:strtype forKey:@"type"];
    [mDictParams setObject:strmid forKey:@"mid"];
    [mDictParams setObject:strpassword forKey:@"password"];
    [mDictParams setObject:strmtype forKey:@"mtype"];
    [mDictParams setObject:strpagecount forKey:@"pagecount"];
    [mDictParams setObject:strkeywords forKey:@"keywords"];
    
    [super getWithURLString:URL_FOUNDING_GET_ALL
                     params:mDictParams
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         blockSuccess(responseObject);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
    
}


//3.4.1 获取众筹列表(首页最新)

- (void)requestFoundingGetLatestWithMid:(NSString *)strmid
                               password:(NSString *)strpassword
                                success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strpassword))
    {
        return;
    }
    [super getWithURLString:URL_FOUNDING_GET_LATEST
                     params:@{@"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         blockSuccess(responseObject);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
    
}


//3.5 获取单个众筹项目详情
- (void)requestFoundingGetOneWithId:(NSString *)strid
                                Mid:(NSString *)strmid
                           password:(NSString *)strpassword
                            success:(void (^)(NSDictionary *dictResponse))blockSuccess
                            failure:(void (^)(NSError *error))blockFailure{
    if (!(strid && strmid && strpassword))
    {
        return;
    }
    
    [super getWithURLString:URL_FOUNDING_GET_One
                     params:@{@"id":strid,
                              @"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([[responseObject objectForKey:@"content"]isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)[responseObject objectForKey:@"content"];
             blockSuccess(dict);
         }

     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
    
}


//3.5.1 获取单个众筹项目赞助列表

- (void)requestFoundingGetOneSponsorWithId:(NSString *) strid
                                       Mid:(NSString *)strmid
                                  password:(NSString *)strpassword
                                 pagecount:(NSString *)strpagecount
                                   success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                   failure:(void (^)(NSError *error))blockFailure{
    if (!(strid && strmid && strpassword && strpagecount))
    {
        return;
    }
    
    [super getWithURLString:URL_FOUNDING_GET_One_SPONSOR
                     params:@{@"id":strid,
                              @"mid":strmid,
                              @"password":strpassword,
                              @"pagecount":strpagecount}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//3.5.2 获取单个众筹项目检测机构信息

- (void)requestFoundingGetOneinstitutionWithId:(NSString *) strid
                                           Mid:(NSString *)strmid
                                      password:(NSString *)strpassword
                                       success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                       failure:(void (^)(NSError *error))blockFailure{
    if (!(strid && strmid && strpassword))
    {
        return;
    }
    [super getWithURLString:URL_FOUNDING_GET_One_INSTITUTION
                     params:@{@"id":strid,
                              @"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([[responseObject objectForKey:@"content"]isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)[responseObject objectForKey:@"content"];
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//3.5.3 获取单个众筹的检测内容
- (void)requestFoundingGetOnepackagesWithId:(NSString *) strid
                                        Mid:(NSString *)strmid
                                   password:(NSString *)strpassword
                                    success:(void (^)(NSArray *dictResponse))blockSuccess
                                    failure:(void (^)(NSError *error))blockFailure{
    if (!(strid && strmid && strpassword))
    {
        return;
    }
    [super getWithURLString:URL_FOUNDING_GET_One_PACKAGES
                     params:@{@"id":strid,
                              @"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         NSObject *dict =(NSDictionary *)[responseObject objectForKey:@"content"];
         if ([dict isKindOfClass:[NSArray class]]) {
             NSArray *array  = (NSArray *)dict;
             blockSuccess(array);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//3.5.4 获取单个众筹的样品信息

- (void)requestFoundingGetOnesamplesWithId:(NSString *) strid
                                       Mid:(NSString *)strmid
                                  password:(NSString *)strpassword
                                   success:(void (^)(NSArray *dictResponse))blockSuccess
                                   failure:(void (^)(NSError *error))blockFailure{
    if (!(strid && strmid && strpassword))
    {
        return;
    }
    [super getWithURLString:URL_FOUNDING_GET_One_SAMPLES
                     params:@{@"id":strid,
                              @"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         NSObject *dict =(NSDictionary *)[responseObject objectForKey:@"content"];
         if ([dict isKindOfClass:[NSArray class]]) {
             NSArray *array  = (NSArray *)dict;
             blockSuccess(array);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//3.5.5 获取单个众筹的评论信息 [包含分页]
- (void)requestFoundingGetOnecommentsWithId:(NSString *) strid
                                        Mid:(NSString *)strmid
                                   password:(NSString *)strpassword
                                  pagecount:(NSString *)strpagecount
                                        pid:(NSString *)strpid
                                    success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                    failure:(void (^)(NSError *error))blockFailure{
    
    if (!(strid && strmid && strpassword))
    {
        return;
    }
    [super getWithURLString:URL_FOUNDING_GET_One_COMMENTS
                     params:@{@"id":strid,
                              @"mid":strmid,
                              @"password":strpassword,
                              @"pagecount":strpagecount,
                              @"pid":strpid}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict = (NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

}

//3.5.6 增加单个众筹的评论信息
- (void)requestFoundingGetOnecommentWithId:(NSString *) strid
                                       Mid:(NSString *)strmid
                                  password:(NSString *)strpassword
                                   content:(NSString *)strcontent
                                       pid:(NSString *)strpid
                                   success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                   failure:(void (^)(NSError *error))blockFailure{
    
    if (!(strid && strmid && strpassword && strcontent))
    {
        return;
    }
    [super getWithURLString:URL_FOUNDING_GET_One_COMMENT
                     params:@{@"id":strid,
                              @"mid":strmid,
                              @"password":strpassword,
                              @"content":strcontent,
                              @"pid":strpid}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         NSObject *dict =(NSObject *)responseObject;
         if ([dict isKindOfClass:[NSDictionary class]]) {
             NSDictionary *array  = (NSDictionary *)dict;
             blockSuccess(array);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//3.5.7 增加单个众筹的收藏信息

- (void)requestFoundingGetOnecolletionWithId:(NSString *) strid
                                         Mid:(NSString *)strmid
                                    password:(NSString *)strpassword
                                ifcollection:(NSString *)strifcollection
                                     success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                     failure:(void (^)(NSError *error))blockFailure{
    if (!(strid && strmid && strpassword))
    {
        return;
    }
    [super getWithURLString:URL_FOUNDING_GET_One_COLLETION
                     params:@{@"id":strid,
                              @"mid":strmid,
                              @"password":strpassword,
                              @"ifcollection":strifcollection}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         NSObject *dict =(NSObject *)responseObject;
         if ([dict isKindOfClass:[NSDictionary class]]) {
             NSDictionary *array  = (NSDictionary *)dict;
             blockSuccess(array);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
    
}

//3.5.8 增加单个众筹的评论的点赞信息
- (void)requestFoundingGetOnecommentlikeWithCId:(NSString *) strcid
                                        Mid:(NSString *)strmid
                                   password:(NSString *)strpassword
                                    success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                    failure:(void (^)(NSError *error))blockFailure{
    
    if (!(strcid && strmid && strpassword))
    {
        return;
    }
    [super getWithURLString:URL_FOUNDING_GET_One_COMMENT_LIKE
                     params:@{@"cid":strcid,
                              @"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         NSObject *dict =(NSObject *)responseObject;
         if ([dict isKindOfClass:[NSDictionary class]]) {
             NSDictionary *array  = (NSDictionary *)dict;
             blockSuccess(array);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}


// 3.6 发起众筹接口
- (void)requestFoundingPublishsWithMid:(NSInteger)strmid
                             password:(NSString *)strpassword
                               pjname:(NSString *)strpjname
                               pdname:(NSString *)strpdname
                             citycode:(NSString *)strcitycode
                                brand:(NSString *)strbrand
                            packageid:(NSString *)strpackageid
                        institutionid:(NSString *)instiutionid
                               emoney:(NSString *)stremoney
                              success:(void (^)(NSDictionary *dictResponse))blockSuccess
                              failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strpassword && strpjname && strpdname && strcitycode && strbrand && strpackageid && instiutionid && stremoney))
    {
        return;
    }
    
    [super postWithURLString:URL_FOUNDING_PUBLISH
                      params:@{@"mid":@(strmid),
                               @"password":strpassword,
                               @"pjname":strpjname,
                               @"pdname":strpdname,
                               @"citycode":strcitycode,
                               @"brand":strbrand,
                               @"packageid":strpackageid,
                               @"institutionid":instiutionid,
                               @"emoney":stremoney}.mutableCopy
                     success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         blockSuccess(responseObject);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
    
}


// 3.7 众筹支付(微信、支付宝、银联)[包括发起人的支付和赞助人的支付]
- (void)requestFoundingPayitWithMid:(NSString *)strmid
                           password:(NSString *)strpassword
                               type:(NSString *)strtype
                               fdid:(NSString *)strfdid
                             donate:(NSString *)strdonate
                              rp_id:(NSString *)strrp_id
                            success:(void (^)(NSDictionary *dictResponse))blockSuccess
                            failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strpassword && strtype && strfdid && strdonate))
    {
        return;
    }
    
    [super getWithURLString:URL_FOUNDING_PAYIT
                     params:@{@"mid":strmid,
                              @"password":strpassword,
                              @"type":strtype,
                              @"fdid":strfdid,
                              @"donate":strdonate,
                              @"rp_id":strrp_id}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         NSObject *object = (NSObject *)responseObject;
         if ([object isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict = (NSDictionary *)object;
             blockSuccess(dict);
         }
        }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
    
}

//3.8 获取项目分享到微信朋友圈的信息
- (void)requestFoundingGetShareWithMid:(NSString *)strmid
                              password:(NSString *)strpassword
                                  fdid:(NSString *)strfdid
                                  type:(NSString *)strtype
                               success:(void (^)(NSDictionary *dictResponse))blockSuccess
                               failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strpassword && strfdid))
    {
        return;
    }
    
    [super getWithURLString:URL_FOUNDING_GET_SHARE
                     params:@{@"mid":strmid,
                              @"password":strpassword,
                              @"fdid":strfdid,
                              @"type":strtype}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([[responseObject objectForKey:@"content"] isKindOfClass:[NSDictionary class]]){
             NSDictionary *dict =(NSDictionary *)[responseObject objectForKey:@"content"];
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//3.9 关注项目

- (void)requestIndexCollectionFoundingsWithMid:(NSString *)strmid
                                      password:(NSString *)strpassword
                                     pagecount:(NSString *)strpagecount
                                       success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                       failure:(void (^)(NSError *error))blockFailure{
    
    if (!(strmid && strpassword))
    {
        return;
    }
    [super getWithURLString:URL_INDEX_GET_COLLECTION_FOUNDINGS
                     params:@{@"mid":strmid,
                              @"password":strpassword,
                              @"pagecount":strpagecount}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict = (NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

    
}

//4.1 通过条形码获取产品资料
- (void)requestProductGetInfoByBarcodeWithMid:(NSString *)strmid
                                      barcode:(NSString *)strbarcode
                                    pagecount:(NSString *)strpagecount
                                      success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                      failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strbarcode))
    {
        return;
    }
    
    [super getWithURLString:URL_PRODUCT_GET_INFO_BY_BARCODE
                     params:@{@"mid":strmid,                                                             @"barcode":strbarcode,
                        @"pagecount":strpagecount}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         blockSuccess(responseObject);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
    
}


//4.2 通过产品id获取产品信息
- (void)requestProductGetInfoByPidWithMid:(NSInteger)strmid
                                      pid:(NSInteger)strpid
                                  success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                  failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strpid))
    {
        return;
    }
    
    [super getWithURLString:URL_PRODUCT_GET_INFO_BY_PID
                     params:@{@"mid":@(strmid),
                              @"pid":@(strpid)}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         blockSuccess(responseObject);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
    
}

//4.3 产品关键字搜索列表

- (void)requestProductGetInfoByKeywordsWithMid:(NSString *)strmid
                                      keywords:(NSString *)strkeywords
                                      keywords_py:(NSString *)strkeywords_py
                                     pagecount:(NSString *)strpagecount
                                       success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                       failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strkeywords))
    {
        return;
    }
    NSString *strurl = nil;
    if ([strpagecount floatValue] >0) {
        strurl = URL_PRODUCT_GET_INFO_BY_KEYWORDSWITHPAGE;
    }else{
        strurl = URL_PRODUCT_GET_INFO_BY_KEYWORDS;
    }
    [super getWithURLString:strurl
                     params:@{@"mid":strmid,
                              @"keywords":strkeywords,
                              @"pagecount":strpagecount}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         blockSuccess(responseObject);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
    
}


//4.4.1 曝光台关键字搜索列表

- (void)requestProductGetUnsafeInfoByKeywordsPageWithMid:(NSString *)strmid
                                                keywords:(NSString *)strkeywords
                                             keywords_py:(NSString *)strkeywords_py
                                               pagecount:(NSString *)strpagecount
                                                 success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                                 failure:(void (^)(NSError *error))blockFailure{
    
    
    if (!(strmid && strkeywords))
    {
        return;
    }
    
    [super getWithURLString:URL_PRODUCT_GET_UNSAFE__INFO_BY_KEYWORDS_PAGE
                     params:@{@"mid":strmid,
                              @"keywords":strkeywords,
                              @"keywords_py":strkeywords_py,
                              @"pagecount":strpagecount}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         blockSuccess(responseObject);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//4.5 获取搜索关键字(正常搜索和曝光台）
#define URL_PRODUCT_GET_SEARCH_KEYWORDS @"/Product/get_search_keywords.html"
- (void)requestProductGetsearchKeywordsWithMid:(NSString *)strmid
                                          password:(NSString *)strpassword
                                       success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                       failure:(void (^)(NSError *error))blockFailure{
    
    if (!(strmid && strpassword))
    {
        return;
    }
    [super getWithURLString:URL_PRODUCT_GET_SEARCH_KEYWORDS
                     params:@{@"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         blockSuccess(responseObject);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//4.6 我要纠错
#define URL_PRODUCT_FEEDBACK_PRODUCT_ERROR @"/Product/feedback_product_error.html"
- (void)requestProductfeedbackProductErrorWithImgid:(NSString *)strimgId
                                               name:(NSString *)strname
                                              brand:(NSString *)strbrand
                                      specification:(NSString *)strspecification
                                                mid:(NSString *)strmid
                                            barcode:(NSString *)strbarcode
                                            success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                            failure:(void (^)(NSError *error))blockFailure{
    
    if (!(strmid && strname))
    {
        return;
    }
    [super postWithURLString:URL_PRODUCT_FEEDBACK_PRODUCT_ERROR
                     params:@{@"mid":strmid,
                              @"img_id":strimgId,
                              @"name":strname,
                              @"brand":strbrand,
                              @"specification":strspecification,
                              @"barcode":strbarcode}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         blockSuccess(responseObject);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

    
}


//5.1 广告列表
- (void)requestIndexadlistsWithMid:(NSString *)mid
                          password:(NSString *)strpassword
                           success:(void (^)(NSDictionary *dictResponse))blockSuccess failure:(void (^)(NSError *error))blockFailure{
    
    [super getWithURLString:URL_INDEX_AD_LISTS
                     params:@{@"mid":mid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         blockSuccess(responseObject);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
    
}

//5.3 首页热点资讯
#define URL_INDEX_LATEST_NEWS @"/Index/latest_news.html"
- (void)requestIndexlatestnewsWithPagecount:(NSString *)strPagecount
                                  rank_type:(NSString *)strRanktype
                                    success:(void (^)(NSDictionary *dictResponse))blockSuccess failure:(void (^)(NSError *error))blockFailure{
    if (!strPagecount || !strRanktype)
    {
        return;
    }
    
    [super getWithURLString:URL_INDEX_LATEST_NEWS
                     params:@{@"pagecount":strPagecount,
                              @"rank_type":strRanktype}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         blockSuccess(responseObject);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//5.3.1 首页热点资讯详情
#define URL_INDEX_NEWS_GET_ONE @"/Index/news_get_one.html"
- (void)requestIndexnewsgetoneWithNewid:(NSString *)strnewid
                                    mid:(NSString *)strmid
                               password:(NSString *)strpassword
                                  ctype:(NSString *)strctype
                                success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                failure:(void (^)(NSError *error))blockFailure{
    if (!strnewid)
    {
        return;
    }
    
    [super getWithURLString:URL_INDEX_NEWS_GET_ONE
                     params:@{@"newsid":strnewid,
                              @"mid":strmid,
                              @"password":strpassword,
                              @"ctype":strctype}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         blockSuccess(responseObject);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//5.3.2 获取热点资讯分享到微信朋友圈
#define URL_INDEX_GET_SHARE_OF_NEWS @"/Index/get_share_of_news.html"
- (void)requestIndexGetShareofnewsWithNewsid:(NSString *)strnewsid
                                        type:(NSString *)strtype
                                     success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                     failure:(void (^)(NSError *error))blockFailure{
    if (!strnewsid)
    {
        return;
    }
    
    [super getWithURLString:URL_INDEX_GET_SHARE_OF_NEWS
                     params:@{@"newsid":strnewsid,
                              @"type":strtype}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([[responseObject objectForKey:@"content"]isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)[responseObject objectForKey:@"content"];
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//5.3.2.1 获取分享到微信朋友圈,成功后的奖励
#define URL_INDEX_GET_SHARE_FINISH @"/Index/get_share_finish.html"
- (void)requestIndexGetSharefinishWithmid:(NSString *)strmid
                                 password:(NSString *)strpassword
                                   newsid:(NSString *)strnewsid
                                  success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                  failure:(void (^)(NSError *error))blockFailure{
    if (!strnewsid)
    {
        return;
    }
    
    [super getWithURLString:URL_INDEX_GET_SHARE_FINISH
                     params:@{@"mid":strmid,
                              @"password":strpassword,
                              @"newsid":strnewsid}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([[responseObject objectForKey:@"content"]isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)[responseObject objectForKey:@"content"];
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
    
    
}

//5.3.3 增加文章的评论信息

- (void)requestIndexGetAddarticleWithNewsid:(NSString *)strnewsid
                                        mid:(NSString *)strmid
                                   password:(NSString *)strpassword
                                    content:(NSString *)strcontent
                                        pid:(NSString *)strpid
                                      ctype:(NSString *)strtype
                                    success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                    failure:(void (^)(NSError *error))blockFailure{
    if (!strnewsid || !strcontent)
    {
        return;
    }

    [super getWithURLString:URL_INDEX_ADD_ARTICLE_COMMENT
                     params:@{@"id":strnewsid,
                              @"mid":strmid,
                              @"password":strpassword,
                              @"content":strcontent,
                              @"pid":strpid,
                              @"ctype":strtype}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//5.3.4 增加文章的收藏信息

#define URL_INDEX_ADD_ARTICLE_COLLECTION @"/Index/add_article_collection.html"
- (void)requestIndexGetAddarticleCollectionWithNewsid:(NSString *)  strnewsid
                                                  mid:(NSString *)strmid
                                             password:(NSString *)strpassword
                                         ifcollection:(NSString *)strifcollection
                                                ctype:(NSString *)strctype
                                              success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                              failure:(void (^)(NSError *error))blockFailure{
    if (!strnewsid)
    {
        return;
    }
    
    [super getWithURLString:URL_INDEX_ADD_ARTICLE_COLLECTION
                     params:@{@"id":strnewsid,
                              @"mid":strmid,
                              @"password":strpassword,
                              @"ifcollection":strifcollection,
                              @"ctype":strctype}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}


//5.3.5 增加文章的点赞信息

#define URL_INDEX_ADD_ARTICLE_COMMENT_LIKE @"/Index/add_article_comment_like.html"
- (void)requestIndexGetAddarticleCommentlikeWithNewscid:(NSString *)  strcid
                                                    mid:(NSString *)strmid
                                               password:(NSString *)strpassword
                                                success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                                failure:(void (^)(NSError *error))blockFailure{
    if (!strcid)
    {
        return;
    }
    
    [super getWithURLString:URL_INDEX_ADD_ARTICLE_COMMENT_LIKE
                     params:@{@"cid":strcid,
                              @"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

}

//5.3.6 获取文章的评论信息
- (void)requestIndexGetAddarticleCommentslikeWithNewscid:(NSString *)strcid
                                                     mid:(NSString *)strmid
                                                password:(NSString *)strpassword
                                               pagecount:(NSString *)strpagecount
                                                     pid:(NSString *)strpid
                                                   ctype:(NSString *)strctype
                                                 success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                                 failure:(void (^)(NSError *error))blockFailure{
    if (!strcid)
    {
        return;
    }
    
    [super getWithURLString:URL_INDEX_ADD_ARTICLE_COMMENTS
                     params:@{@"id":strcid,
                              @"mid":strmid,
                              @"password":strpassword,
                              @"pagecount":strpagecount,
                              @"pid":strpid,
                              @"ctype":strctype}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject ;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//5.4 首页标签

- (void)requestIndextagsWithsuccess:(void (^)(NSDictionary *dictResponse))blockSuccess failure:(void (^)(NSError *error))blockFailure{
    
    [super getWithURLString:URL_INDEX_TAGS
                     params:nil
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         blockSuccess(responseObject);
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//5.5 增加文章的点赞信息
#define URL_INDEX_GET_COLLECTION_NEWS @"/Index/get_collection_news.html"
- (void)requestIndexGetCollectionNewsmid:(NSString *)strmid
                                password:(NSString *)strpassword
                               pagecount:(NSString *)strpagecount
                                 success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                 failure:(void (^)(NSError *error))blockFailure{
    [super getWithURLString:URL_INDEX_GET_COLLECTION_NEWS
                     params:@{@"mid":strmid,
                              @"password":strpassword,
                              @"pagecount":strpagecount}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//5.6.1 获取首页常见问题列表
- (void)requestIndexgetfaqlistWithsuccess:(void (^)(NSDictionary *dictResponse))blockSuccess failure:(void (^)(NSError *error))blockFailure{
    
    [super getWithURLString:URL_INDEX_GET_FAQ_LIST
                     params:nil
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

}

//5.6.2 危害须知
- (void)requestIndexgetharmlistWithsuccess:(void (^)(NSDictionary *dictResponse))blockSuccess failure:(void (^)(NSError *error))blockFailure{
    [super getWithURLString:URL_INDEX_GET_HARM_LIST
                     params:nil
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//5.6.3 食事周刊列表
- (void)requestIndexGetweeklylistpagecount:(NSString *)strpagecount
                                   success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                   failure:(void (^)(NSError *error))blockFailure{
    
    [super getWithURLString:URL_INDEX_GET_WEEKLY_LIST
                     params:@{@"pagecount":strpagecount}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
         failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

}

//5.6.3.1 食事周刊热门评论
- (void)requestIndexGetweeklygetoneid:(NSString *)strid
                              success:(void (^)(NSDictionary *dictResponse))blockSuccess
                              failure:(void (^)(NSError *error))blockFailure{
    
    [super getWithURLString:URL_INDEX_GET_WEEKLY_GET_ONE
                     params:@{@"id":strid}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
         failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//5.6.4 获取食事周刊分享到微信朋友圈
#define URL_INDEX_GET_SHARE_WEEKLY_LIST @"/Index/get_share_of_weekly.html"
- (void)requestIndexGetweeklylistnewsid:(NSString *)strnewsid
                                   type:(NSString *)strtype
                                success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                failure:(void (^)(NSError *error))blockFailure{
    
    [super getWithURLString:URL_INDEX_GET_SHARE_WEEKLY_LIST
                     params:@{@"newsid":strnewsid,
                              @"type":strtype}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([[responseObject objectForKey:@"content"]isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)[responseObject objectForKey:@"content"];
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//6.1 获取用户的学生资料数据
- (void)requestAcsuzhouXwsMemberInfomid:(NSString *)strmid
                               password:(NSString *)strpassword
                                success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                failure:(void (^)(NSError *error))blockFailure{
    [super getWithURLString:URL_ACSUZHOU_XWS_MEMBER_INFO
                     params:@{@"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

}

//6.2 获取学生的投票详情
- (void)requestAcsuzhouXwaVoteDetailmid:(NSString *)strmid
                               password:(NSString *)strpassword
                                    sid:(NSString *)strid
                                success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                failure:(void (^)(NSError *error))blockFailure{
    [super getWithURLString:URL_ACSUZHOU_XWS_VOTE_DETAIL
                     params:@{@"mid":strmid,
                              @"password":strpassword,
                              @"id":strid}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

}

//6.2.1 获取学生的投票详情的分享链接
- (void)requestAcsuzhouXwaGetSharemid:(NSString *)strmid
                             password:(NSString *)strpassword
                                  pid:(NSString *)strpid
                                 type:(NSString *)strtype
                              success:(void (^)(NSDictionary *dictResponse))blockSuccess
                              failure:(void (^)(NSError *error))blockFailure{
    [super getWithURLString:URL_ACSUZHOU_XWS_GET_SHARE
                     params:@{@"mid":strmid,
                              @"password":strpassword,
                              @"id":strpid,
                              @"type":strtype}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([[responseObject objectForKey:@"content"]isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)[responseObject objectForKey:@"content"];
             blockSuccess(dict);
         }

     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//6.3 发起投票
- (void)requestAcsuzhouXwaSubmitmid:(NSString *)strmid
                           password:(NSString *)strpassword
                           thumb_id:(NSString *)strthumb_id
                             slogan:(NSString *)strslogan
                            success:(void (^)(NSDictionary *dictResponse))blockSuccess
                            failure:(void (^)(NSError *error))blockFailure{
    
    [super postWithURLString:URL_ACSUZHOU_XWS_SUBMIT
                     params:@{@"mid":strmid,
                              @"password":strpassword,
                              @"thumb_id":strthumb_id,
                              @"slogan":strslogan}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

}

//6.3.1 图片上传
- (void)requestAcsuzhouXwaImageUploadmid:(NSString *)strmid
                                password:(NSString *)strpassword
                                   image:(NSArray *)strimage
                                 success:(void (^)(NSData *data))blockSuccess
                                 failure:(void (^)(NSError *error))blockFailure{
    if (!(strmid && strpassword && strimage))
    {
        return;
    }
    NSMutableDictionary *mDictParams = [NSMutableDictionary new];
    [mDictParams setObject:strmid forKey:@"mid"];
    [mDictParams setObject:strpassword forKey:@"password"];
    
    [super uploadWithURLString:URL_ACSUZHOU_XWS_IMAGE_UPLOAD params:mDictParams images:strimage filename:@"image" success:^(AFHTTPRequestOperation *operation, id responseObject) {
        NSLog(@"图片1123");
        blockSuccess(responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
    }];
}

//6.4 获取学生的抽奖情况

- (void)requestAcsuzhouPrizeRecordmid:(NSString *)strmid
                             password:(NSString *)strpassword
                              success:(void (^)(NSDictionary *dictResponse))blockSuccess
                              failure:(void (^)(NSError *error))blockFailure{
    [super getWithURLString:URL_ACSUZHOU_PRIZE_RECORD
                     params:@{@"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//6.4。1 获取学生的投票列表

- (void)requestAcsuzhouXwsVotelistmid:(NSString *)strmid
                             password:(NSString *)strpassword
                            pagecount:(NSString *)strPagecount
                              keyword:(NSString *)strkeyword
                                 type:(NSString *)strtype
                              success:(void (^)(NSDictionary *dictResponse))blockSuccess
                              failure:(void (^)(NSError *error))blockFailure{
    
    [super getWithURLString:URL_ACSUZHOU_XWS_LIST
                     params:@{@"mid":strmid,
                              @"password":strpassword,
                              @"pagecount":strPagecount,
                              @"keyword":strkeyword,
                              @"type":strtype}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}

//6.5  抽奖接口
- (void)requestAcsuzhouGetPrizemid:(NSString *)strmid
                          password:(NSString *)strpassword
                           success:(void (^)(NSDictionary *dictResponse))blockSuccess
                           failure:(void (^)(NSError *error))blockFailure{
    [super getWithURLString:URL_ACSUZHOU_GET_PRIZE
                     params:@{@"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

}

//7.1.1 获取当前用户和活动的参与资料
#define URL_ACSHIYAO_GET_MEMBER_INFO @"/Acshiyaoju/get_member_info.html"
- (void)requestAcshiyaojuGetMemberInfomid:(NSString *)strmid
                                 password:(NSString *)strpassword
                                  success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                  failure:(void (^)(NSError *error))blockFailure{
    
    [super getWithURLString:URL_ACSHIYAO_GET_MEMBER_INFO
                     params:@{@"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}


//7.1.2 获取当前开放活动城市
#define URL_ACSHIYAO_GET_CITIES @"/Acshiyaoju/get_cities.html"
- (void)requestAcshiyaojuGetCitiesmid:(NSString *)strmid
                             password:(NSString *)strpassword
                              success:(void (^)(NSDictionary *dictResponse))blockSuccess
                              failure:(void (^)(NSError *error))blockFailure{
    
    [super getWithURLString:URL_ACSHIYAO_GET_CITIES
                     params:@{@"mid":strmid,
                              @"password":strpassword}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];

    
}

//7.1.3 更新会员的城市绑定信息
#define URL_ACSHIYAO_UPDATE_MEMBER_INFO @"/Acshiyaoju/update_member_info.html"
- (void)requestAcshiyaojuUpdateMemberInfomid:(NSString *)strmid
                                    password:(NSString *)strpassword
                                 region_code:(NSString *)strregion_code
                                     success:(void (^)(NSDictionary *dictResponse))blockSuccess
                                     failure:(void (^)(NSError *error))blockFailure{
    
    [super getWithURLString:URL_ACSHIYAO_UPDATE_MEMBER_INFO
                     params:@{@"mid":strmid,
                              @"password":strpassword,
                              @"region_code":strregion_code}.mutableCopy
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
     {
         if ([responseObject isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict =(NSDictionary *)responseObject;
             blockSuccess(dict);
         }
     }
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)
     {
         blockFailure(error);
     }];
}


@end
